package com.jobs.TreeHashDemo;


import com.jobs.util.SecurityHelper;

import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Files;
import java.util.HashSet;

/**
 * @author 王博
 */
public class HashSetMain {
    public static void main(String[] args) throws  Exception{
        HashSet<Student> hashSet = new HashSet<>();
        hashSet.add(new Student(1, 18, "张三", "男", true));
        hashSet.add(new Student(2, 19, "李四", "男", false));
        hashSet.add(new Student(3, 20, "王五", "男", true));
        hashSet.add(new Student(4, 21, "赵六", "男", false));
        hashSet.add(new Student(5, 22, "孙七", "男", true));
        hashSet.add(new Student(6, 18, "张三", "男", true));
        hashSet.add(new Student(7, 20, "王五", "男", true));
        System.out.println("*************************************");
        hashSet.forEach(System.out::println);
        System.out.println("*************************************");


        boolean contains1 = hashSet.contains(new Student(7, 20, "王五", "男", true));
        System.out.println(contains1);
        System.out.println("*************************************");
        boolean contains2 = hashSet.contains(new Student(14, 78, "王五", "男", true));
        System.out.println(contains2);

    }

}
